package com.cnpc.ds;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableAsync
@EnableScheduling
@MapperScan("com.cnpc.ds.mapper")
@ServletComponentScan(basePackages = {"com.cnpc.ds"})
@Slf4j
public class ServiceApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(ServiceApplication.class, args);
        Environment environment = context.getBean(Environment.class);
        log.info("服务：{},启动完成！端口：{},环境：{}", environment.getProperty("spring.application.name"), environment.getProperty("server.port"), environment.getActiveProfiles());
    }
}